// TeacherViewController.swift
import UIKit

class TeacherViewController: UIViewController {
    override func viewDidLoad() {
        super.viewDidLoad()
        
        // 初始化数据库
        let sqlManager = SQLManager.shareInstance()
        sqlManager.createDataBaseTableIfNeeded()
    }
    
    // 添加课程方法
    func addCourse(courseId: String, courseName: String, teacher: String) {
        let sqlManager = SQLManager.shareInstance()
        let addSQL = "INSERT INTO course (id, course_name, teacher) VALUES ('\(courseId)', '\(courseName)', '\(teacher)');"
        if sqlManager.execSQL(SQL: addSQL) {
            print("添加课程成功！")
        } else {
            print("添加课程失败！")
        }
    }
}
